package org.act.xservices.rt.xcontainer.service.resolver;

import org.act.xservices.rt.xcontainer.inf.context.IServiceContext;
import org.act.xservices.rt.xcontainer.inf.service.wsdl.XcService;
import org.act.xservices.rt.xcontainer.inf.service.wsdl.XcServiceRegistry;

public class RequestURIBasedServiceResolver extends AbstractServiceResolver {

	private final static String NAME = "RequestURIBasedServiceResolver";

	@Override
	protected void init() {
		this.name = NAME;
	}
	
	
	/** 
	 * 
	 * @param serviceContext
	 * @param xcServiceRegistry
	 * @return
	 * @throws ResolverProcessException
	 */
	@Override
	public XcService findService(IServiceContext serviceContext,
			XcServiceRegistry xcServiceRegistry) throws ResolverProcessException {
		
		String uri = serviceContext.getRequestURI();
		
		return xcServiceRegistry.getXcServiceByURL(uri);

	}

}
